/*
 * MergeEntry.h
 *
 */

#ifndef MERGEENTRY_H_
#define MERGEENTRY_H_

template <class T>
class MergeEntry {
	private:
		SecuentialFile<T> file;
		T record;

	public:
		MergeEntry(BigInt blockSize) : file(blockSize) {}

		virtual ~MergeEntry() {
			file.close();
		}

		void close() {
			file.close();
		}

		void open(const String& path) {
			file.open(path);
			file.next(record);
		}

		T& getRecord() {
			return record;
		}

		bool next() {
			return file.next(record);
		}
};

#endif  /* MERGEENTRY_H_ */
